package com.boe.csb.core.common.exception;

/**
 * Created by louie on 16-11-16.
 */
public enum CSBErrorCode {


    SUCCESS(0, "执行成功"),
    NOT_FOUND(101, "未找到对应的实体"),
    PARAM_ERR(102, "参数异常"),

    WRONG_STATE(201, "错误的状态"),
    STATE_CHANGE_ERROR(202, "状态转换失败"),

    NO_AUTH(300, "没有权限"),
    NOT_LOGIN(301, "未登录"),
    USER_NOT_EXIT(302, "用户不存在"),
    PWD_ERR(303, "密码错误"),
    USER_ALREADY_EXISTS(304, "用户已存在"),
    REIGST_PARAM_EMPTY(305, "注册信息存在空项"),
    VERIFY_CODE_ERR(306, "验证码错误"),
    USER_ALREADY_LOGOUT(307, "用户已经退出"),
    
    MOBILE_VERIFY_CODE_NOT_EXITS(310, "短信验证码不存在"),
    MOBILE_VERIFY_CODE_EXPIRED(311, "短信验证码已经失效"),
    MOBILE_VERIFY_CODE_ERR(312, "短信验证码错误"),
    MOBILE_VERIFY_TOO_OFTEN(313, "短信发送调用太频繁"),
    MOBILE_ALREADY_USED(314, "该手机号已经被使用"),
    MOBILE_SEND_ERR(315, "短信发送失败"),
    MOBILE_NUM_NOT_MATCH(316, "注册手机号和获取验证码手机号不匹配"),
    
    USER_NAME_NOTBE_EMPTY(324, "用户名不能为空"),
    USER_PWD_NOTBE_EMPTY(325, "密码不能为空"),
    USER_NOT_ADMIN(326, "该用户非管理员"),
    USER_IS_ADMIN(327, "该用户为管理员"),
    USER_NOT_CERTIFICATION(328,"用户未认证"),
    USER_CERTIFICATION(329,"用户已经认证"),
    ADMIN_CANT_DELETE_MYSELF(330,"管理员不能删除自己"),
    USER_OLD_PWD_ERR(331,"用户原始密码错误"),

    ACTIVE_INFO_ERR(350, "激活信息异常"),
    USER_ALREADY_ACTIVE(351, "用户已激活"),
    SEND_MAIL_ERR(352, "发送邮件失败"),
    USER_NOT_ACTIVE(353, "用户未激活"),
    ACTIVE_FAIL(354, "激活失败"),
    USER_MAIL_ERR(355, "邮箱不存在"),

    DB_ERROR(401, "数据库相关错误"),

    UNKNOWN_ERROR(500, "UNKNOWN_ERROR"),
    BASIC_ERROR(501, "BASIC_ERROR"),

    UPLOAD_ERROR(601,"上传文件失败"),
    SEND_EMAIL(602,"发送邮件失败"),
    PIC_NOT_FOUND(603,"图片找不到"),

    ADD_RECOMMEND_OVER_LIMIT(701, "超出精品服务数量限制"),
    ADD_RECOMMEND_NOT_EXISTS(702, "该服务不是通过BOE API Store发布"),
    ADD_RECOMMEND_ERR(703, "添加出现未知异常"),
    DEL_RECOMMEND_ERR(704, "删除失败"),
    SERVICE_STATUS_FORBIDDEN(705,"服务状态未通过审核"),


    //其他异常
    CATEGORY_ERR(800,"api一级类目数量超过7个,插入失败"),
    CATEGORY_SERVICE_EXIST(801,"此类目下服务列表不为空,删除失败"),
    CATEGORY_SEC_EXIST(802,"此类目下二级类目不为空,删除失败"),
    CERTIFICATION_TYPE_CHANGE(803,"用户认证类型不能修改"),

    SYS_EXP(1000, "系统异常,请联系管理员"),


    //订单类错误
    ORDER_NOT_BELONG_USER(700,"服务不属于该用户,操作失败!")
    ;
    


    private Integer code;
    private String message;

    private CSBErrorCode(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
